<?php
/*
 * 进云智能生成平台
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
 */

defined('BY_JYA') or exit('error');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'info';
$return=array();
//查询当前粉丝是否关注当前公众号
$fans = cfc('core')->get_fans($_SESSION['openid']);
$fansinfo = pdo_get('core_fans',array('id'=>$fans['id'],'uniacid'=>$_SESSION['uniacid']));
$follow = $fansinfo['follow'];
set_html('title','个人资料');
if($_RQ['op']=='info'){
		if($_RQ['id']){
		$id=intval($_RQ['id']);
	}
	if(!$id){
		
		exi('参数错误！','error');
	}
	 //查询对应活动的参数
	$item=pdo_get('jy_h5game_reply',array('id'=>$id,'uniacid'=>$_SESSION['uniacid']));
	//获取当前时间
	$time = time();
	//玩家是否被拉黑
	$shielding = pdo_get('jy_h5game_fans',array('fansId'=>$fansinfo['mid'],'uniacid'=>$_SESSION['uniacid']),'shielding');
	//查询当前玩家信息
	
	$playinfo = $this->get('fans',array('fansId'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
	//exi($playinfo,'error');
	$urla = array('action'=>'award','query'=>'id='.$id,'plugin'=>'jy_h5game');
	$urlb = array('action'=>'notice','query'=>'id='.$id,'plugin'=>'jy_h5game');
	$urlc = array('action'=>'rankings','query'=>'rid='.$id,'plugin'=>'jy_h5game');
	
	$return['item']=$item;
	$return['urla']=$urla;
	$return['urlb']=$urlb;
	$return['urlc']=$urlc;
	$return['playinfo']=$playinfo;
	$return['id']=$id;
	exi($return);
}
if($_RQ['op']=='post'){
			$return=array();			
			$rid = $_RQ['rid'];
			$data=array(
				//'name'=>$_RQ['name'],
				'ausername'=>$_RQ['ausername'],
				'tel'=>$_RQ['tel'],
				'weixin'=>$_RQ['weixin'],
				'address'=>$_RQ['address'],
				'uniacid' => $_SESSION['uniacid'],
				'createtime' => time()
			);
			//exi($data,'error');
			//$this->update('fans',$data,array('rid'=>$rid,'fansID'=>$_SESSION['uid']));
			pdo_update('jy_h5game_fans',$data,array('fansId'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
		    $message=1;
			$return['message']=$message;
			exi($return);
		//	exi('提交成功','',array('action'=>'info','plugin'=>'jy_h5game','query'=>'id='.$rid));						
								
}